#!/usr/bin/env bash

# convert-maccallum-me.sh

# This programs purpose is to locally convert Hypert Text Markup files from
# the maccallum.me website and its sub-domains to text files.

# Copyright (C) 2009 Scott C. MacCallum
# scottmaccal@gmail.com

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#       |                                  80 Columns                                    |

############################################################################
# Find all of the maccallum.me and its sub-domains Hyper Text Markup files #
# and copy them to the text directory.                                     #  
############################################################################

convert-maccallum-me()
{
  find ~/programming-maccallum-me/html -name '*.html' -type f -exec sh -c 'exec cp --verbose --preserve=mode,ownership,timestamps --force "$@" ~/programming-maccallum-me/html/html' find-copy {} +

  html2text ~/programming-maccallum-me/html/html/* > /home/scottmaccal/programming-maccallum-me/text/raw.txt

  cat raw.txt | text2odf raw.odt
}
convert-maccallum-me
#END OF FILE
